﻿using System;
using System.Windows.Forms;
using RemoteTestRunner.BusinessLogic.Models;
using RemoteTestRunner.BusinessLogic.Views;

namespace RemoteTestRunner.BusinessLogic.Presenters
{
    public class EditProjectsPresenter : DialogPresenterBase
    {
        private readonly IEditProjectsView _view;

        public EditProjectsPresenter(IEditProjectsView view)
        {
            _view = view;
        }

        public override void Start()
        {
            _view.Model = RtrServiceResolver.Service;
            if (_view.ShowDialog(Parent) == DialogResult.OK)
            {
                RtrServiceResolver.OnDataChanged(this, EventArgs.Empty);
            }

            // Show Edit Projects dialog
            //using (ProjectAdmin projectAdmin = new ProjectAdmin(_serviceFacade))
            //{
            //    if (projectAdmin.ShowDialog(this) == DialogResult.OK)
            //    {
            //        _reloadProjectsListener(this, e);
            //    }
            //}
        }

        public override void Stop()
        {
            _view.Close();
        }
    }
}